package org.springframework.transaction.interceptor;


public class Utils {
	
	/**
	 * Check arguments if it is a valid transaction id. Transaction id is UUID.
	 * @param arg
	 * @return
	 */
	public static boolean checkId(Object arg) {
		String regexTransactionId = "^\\S{8}-\\S{4}-\\S{4}-\\S{4}-\\S{12}$";
		if(arg != null && arg.getClass().isAssignableFrom(String.class)) {
			return arg.toString().matches(regexTransactionId);
		}
		return false;
	}
}
